<?php

use common\widgets\GridView;
use common\widgets\pages\CustomTabs as Tabs;
use common\widgets\pages\GridViewPage;
use yii\helpers\Html;

/* @var $this yii\web\View */
/* @var $model yii\base\Model */
/* @var $dataProvider yii\data\ActiveDataProvider */
/* @var array gridViewConfig */
/* @var array $gridViewActionConfig */
/* @var array $gridViewActionButtons */
/* @var GridViewPage $_page */

$this->title = $_page->pageTitle;

$model = $_page->searchModel;

$this->params['breadcrumbs'] = [
    $_page->pageTitle
];

$grid = GridView::widget($gridViewConfig);

$tabContent = $_page->getBeforeGridViewHtml() . $grid . $_page->getAfterGridViewHtml();;
$tabsConfig = $_page->tabs;
$tabsConfig['items'][0]['content'] = $tabContent;

$content = Tabs::widget($tabsConfig);

$content = $_page->getBeforeTabsHtml() . $content . $_page->getAfterTabsHtml();

echo Html::tag("div",
    Html::tag("div", $content, ['class' => "col-xs-12 " . \yii\helpers\Inflector::slug($model->className()) . "grid-view"]),
    ['class' => "row"]
);
